package org.luxor.eshop.storage.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.luxor.commons.core.validator.group.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 商品
 *
 * @author administrator @date 2020-12-04 15:58:21
 */
@Data
@TableName("tb_commodity")
@ApiModel(description = "商品")
public class CommodityEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键Id")
	@JSONField(serializeUsing = ToStringSerializer.class)
	@NotNull(message = "commodityId，不能为空", groups = UpdateGroup.class)
	private Long commodityId;

	@ApiModelProperty(value = "商品编号")
	@NotBlank(message = "commodityCode，不能为空")
	private String commodityCode;

	@ApiModelProperty(value = "商品名称")
	@NotBlank(message = "commodityName，不能为空")
	private String commodityName;

	@ApiModelProperty(value = "库存数量")
	@NotNull(message = "onhand，不能为空")
	private Integer onhand;

	@ApiModelProperty(value = "商品单价")
	@NotBlank(message = "commodityPrice，不能为空")
	private BigDecimal commodityPrice;

	@ApiModelProperty(value = "商品分类")
	private String commodityClassify;

}
